<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>

<div id="template_marketplace_search">
    <form action="{url link='marketplace'}" method="POST">
        <input type="hidden" name="search[submit]" value="1">
        <div>
            <input type="text" name="search[search]" id="search" placeholder="Type the location you want to looking for"/>
        </div>
		<div class="separate"></div>
        <div id="image_template_holder">
            <input type="hidden" name="search[main_category]" id="main_category" value=""/>
            {foreach from=$aCategories item=aCategory}
                {if !empty($aCategory.icon)}
                <a class="category_icon" href="#" id="marketplace_icon_{$aCategory.category_id}" title="{$aCategory.name}" onclick="$('#main_category').val($(this).attr('rel'));$('.category_icon').removeClass('activated');$(this).addClass('activated');$('#category_select').val('');return false;" rel="{$aCategory.category_id}">{img theme=$aCategory.icon}</a>
                {/if}
            {/foreach}
        </div>
        <div class="categories">
            <span>Categories</span> <select name="search[category]" id="category_select" onchange="$('main_category').val('');$('.category_icon').removeClass('activated');">
                <option value="">Select category</option>
                {foreach from=$aCategories item=aCategory}
                {if empty($aCategory.icon)}
                <option value="{$aCategory.category_id}">{$aCategory.name}</option>
                {/if}
                {/foreach}
            </select>
        </div>
		<div class="separate"></div>
        <div>
            <input type="submit" class="button" value="Search"/>
            <input type="button" class="button cancel" value="Cancel" onclick="tb_remove();return false;"/>
        </div>
    </form>
</div>